function makeOverviewImgsOutput(baseline_mat, new_mat, results_mat)
load_settings;
% baseline_mat = 'iter_data2.mat';
% new_mat = 'iter_new_data2.mat';
% results_mat = 'iter_baseline_iter_new.mat';

load([people_root 'data/' baseline_mat]);
load([people_root 'data/' new_mat]);
load([people_root 'results/' results_mat]);

disp('Generating baseline overview imgs');

ann = organize_ann(ANN_TE, YTE, baseline.TE.p);

for ix = 1:length(ann)
    fprintf('Done %d out of %d\n', ix, length(ann));
    img = imread(ann(ix).image);
    file = regexprep(ann(ix).image(24:end), '/', '_');
    out_file = [overview_root 'predictions/' results_mat(1:end-4) '/baseline_' file];
    imshow(img);
    title(out_file);
    for jx = 1:size(ann(ix).ppl_rects,1)
        color = 'g';
        if ann(ix).ppl_pred(jx) == -1;
            color = 'r';
        end
        rectangle('Position', ann(ix).ppl_rects(jx,:), 'EdgeColor', color);
    end
    for jx = 1:size(ann(ix).bg_rects,1)
        color = 'b';
        if ann(ix).bg_pred(jx) == 1;
            color = 'm';
        end
        rectangle('Position', ann(ix).bg_rects(jx,:), 'EdgeColor', color);
    end
    hold off;
    pause(1);
    f=getframe(gca);
    [X, map] = frame2im(f);
    pause(2);
    imwrite(X, out_file, 'jpeg');
    pause(2);
end  

%%
disp('Generating new overview imgs');

ann = organize_ann(NEWANN_TE, NEWYTE, new.TE.p);

for ix = 1:length(ann)
    fprintf('Done %d out of %d\n', ix, length(ann));
    img = imread(ann(ix).image);
    file = regexprep(ann(ix).image(24:end), '/', '_');
    out_file = [overview_root 'predictions/' results_mat(1:end-4) '/new_' file];
    imshow(img);
    title(out_file);
    for jx = 1:size(ann(ix).ppl_rects,1)
        color = 'g';
        if ann(ix).ppl_pred(jx) == -1;
            color = 'r';
        end
        rectangle('Position', ann(ix).ppl_rects(jx,:), 'EdgeColor', color);
    end
    for jx = 1:size(ann(ix).bg_rects,1)
        color = 'b';
        if ann(ix).bg_pred(jx) == 1;
            color = 'm';
        end
        rectangle('Position', ann(ix).bg_rects(jx,:), 'EdgeColor', color);
    end
    hold off;
    pause(1);
    f=getframe(gca);
    [X, map] = frame2im(f);
    pause(2);
    imwrite(X, out_file, 'jpeg');
    pause(2);
end  

end